<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/9
 * Time: 13:43
 */
include '../classes/conn.php';
include "../classes/logincheck.php";
if(islogin()=="teacher_login"){
    $stu_nums=$_POST['stu_nums'];
    $class_num=$_POST['class_num'];
    $fail=0;
    for($i=0;$i<count($stu_nums);$i++){
        $query="delete from student where num='{$stu_nums[$i]}' and class='{$class_num}' and teacher='{$_SESSION['t_num']}'";
        $res=mysql_query($query);
        if(!$res){
            $fail++;
        }
    }
    if($fail>0){
        echo "0";
    }
    else{
        echo '1';
    }
}
else{
    echo '0';
}